<div class="navbar navbar-fixed-top navbar-inverse">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/main">{{ title }}</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                {% for url,label in topLinks %}
                {% if index == url%}
                <li class="active"><a href="{{url}}">{{label}}</a></li>
                {% else %}
                <li><a href="{{url}}">{{label}}</a></li>
                {% end %}
                {% end %}
            </ul>
            <form method="post" target="_blank" action="/search" class="navbar-form form-inline pull-left">
                {% module xsrf_form_html() %}
                <input class="form-control col-lg-8" name="keyword" type="text" placeholder="点击此处进行搜索">
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#" id="favorites" rel="sidebar">收藏本页</a></li>
                <li id="personalBar" class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        {%if user%}欢迎你，{{user['username']}}。{% else %}登录/注册{% end %}
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                       {% raw '<li class="divider"></li>'.join(map(lambda link: ('<li><a href="#" id="%s">%s</a></li>' % link), selfLinks)) %}
                    </ul>
                </li>
                <li id="qqAuthBar"></li>
                <li id="googleAuthBar"></li>
                <li>
                    <a href="/rss.xml" target="_blank">
                        <img title="收取站点更新通知" class="navbar-icon" src='{{ static_url("image/rss.png") }}'/>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>